import { dayjs } from 'element-plus'

export const formatTime = (time:any) => dayjs(time).format('YYYY年MM月DD日')

export const formatChatTime = ():any =>{
  // 创建一个表示当前时间的时间对象
  const currentDate = new Date();

  // 获取年、月、日、小时、分钟和秒数
  const year = currentDate.getFullYear();
  const month = currentDate.getMonth() + 1; // 月份从 0 开始，需要加 1
  const day = currentDate.getDate();
  const hour = currentDate.getHours();
  const minute = currentDate.getMinutes();
  const second = currentDate.getSeconds();

  // 格式化日期时间
  const formattedDateTime = `${year}/${month}/${day} ${hour}:${minute}:${second}`;
  return formattedDateTime;
}

